{%extends "base.html"%}
{%block title%}首页{%endblock%}
{%block sideleft%}{%include "sideleft.html"%}{%endblock%}
{%block content%}
<!--登录成功以后的内容-->
<!-- <div class="activity">
	<h3>我要参加活动:</h3></br>
	<form action="addActivity/" method="post">{%csrf_token%}
		
		我&nbsp;{{form.date}}&nbsp;要&nbsp;{{form.activity}}        
	
		<input type="submit" value="确定"/>
	</form>
</div> -->
{%if addActivity%}
	<script type="text/javascript">
		$(function(){
			addActivity()
		})
	</script>
{%endif%}
<div class='myfriends'>
	<!-- <h3>好友的活动:{%now "Y-m-d"%}</h3> -->
	
	<ul id="portfolio">
	{%for fl in fa.0%}
		<li class='friendsactivity'>
			<div class='profile_image'>
				<a href="activitys/people/{{fl.userid}}"><image src="{{fl.profile_image}}" alt="{{fl.username}}" title="{{fl.username}}"></image></a>
			</div>
		{%if fl.a_id|divisibleby:2%}
			<div class='activity_info'>
		{%else%}
			<div class='odd_activity_info'>
		{%endif%}
				<a href="/activity/{{fl.id}}"><span class='activity_name'>{{fl.activityname}}</span></a>
				<span class="activity_author">{{fl.username}}</span>
				<span class='activity_date'>在{{fl.cityname}}&nbsp;
				{%ifequal fl.date|date:"Y-m-d" "2008-03-08"%}
					最近的活动</span>
				{%else%}
					{{fl.date|date:"Y-m-d"}}的活动</span>
				{%endifequal%}
				<div id='actiinfo_link'>
				    <a href="activity/{{fl.id}}/do" class='a_button'>我也去</a>
					<a href="javascript:void(0)" class='s_button'>提建议<p style="display:none">{{fl.id}}</p></a>				
				</div>
			</div>
		</li>
	{%endfor%}
	<!-- </ul>

	<h3>异地好友的活动:</h3>
	<ul id="portfolio"> 
	{%for fl in fa.1%}	
		<li class='friendsactivity'>
			<div class='profile_image'>
				<a href="/people/{{fl.userid}}"><image src="{{fl.profile_image}}" alt="{{fl.username}}" title="{{fl.username}}"></image></a>
			</div>
			<div class='activity_info'>
				<a href="/activity/{{fl.id}}"><span class='activity_name'>{{fl.activityname}}</span></a>
				<span class="activity_author">{{fl.username}}</span>
				<span class='activity_date'>在{{fl.city}}&nbsp;
				{%ifequal fl.date|date:"Y-m-d" "2008-03-08"%}
					最近的活动</span>
				{%else%}
					{{fl.date|date:"Y-m-d"}}的活动</span>
				{%endifequal%}
			  <div id='actiinfo_link'>
			    <a href="activity/{{fl.id}}/do" class='a_button'>我也去</a>
				<a href="javascrpt:void(0)" class='s_button'>提建议<p style="display:none">{{fl.id}}</p></a>
				
			 </div>
			</div>
		</li>
	{%endfor%}-->
	</ul>
	<h3>还有些好友不知道要去干啥，快邀请他们吧:</h3>
	<ul id="portfolio">
	{%for fl in fa.2%}
		<li class='invitefriends'>
			<image src="{{fl.profile_image}}" alt="{{fl.friend}}" title='{{fl.friend}}'><span id='invite_username'>{{fl.friend}}</span></image>
			<div id='actiinfo_link'>
				<a href='javascrpt:void(0)' class='button' id="{{fl.friend}}">邀请他<p style="display:none">{{fl.friend}}</p></a>
			</div>
		</li>
	{%endfor%}
	</ul>
	
</div>

<div id='message_box'>
<p>发送邀请:邀请您的好友一起来组织参加活动吧</p></br>
    <a href="#" class="close" title="关闭">关闭</a> 
	<form action="invite/" method="post">{%csrf_token%}		
		   <table border="0" cellpadding="0" >
        		{{messageform.as_table}}        
    	   </table>	
		<input type="submit" value="确定" class='message_button' />
	</form>
</div>

<div id='suggestion_box'>
	<p>
		给这个活动一些建议吧
	</p>
    <a href="javascript:void(0)" title="关闭"><div class="close">关闭</div></a> 
	<form action="addSuggestion/" method="post">{%csrf_token%}		
		   <table border="0" cellpadding="0" >
        		{{suggestionform.as_table}}        
    	   </table>	
		<input type="submit" value="确定" class='suggestion_button' />
	</form>
</div>

{%endblock%}
{%block sideright%}{%include "sideright.html"%}{%endblock%}


   